<span *ngIf="status?.hash">
    <span class="file-attr"
          title="File size = {{status.size}}">{{status.size | slSize}}</span>,
    <span class="file-attr"
          title="Last modification time">{{status.lastModification | date : 'yyyy-MM-dd HH:mm:ss'}}</span>
</span>
<span [ngSwitch]="status?.errorType">
    <span *ngSwitchCase="'NoSuchFileException'" class="file-not-found">
        file not found
    </span>
    <span *ngSwitchCase="'AccessDeniedException'" class="file-error" title="Access denied by OS">
        access Denied
    </span>
    <span *ngSwitchCase="'DirectoryNotVisibleException'" class="file-error" title="Access denied in application configuration">
        access denied <span class="fas fa-wrench"></span>
    </span>
    <span *ngSwitchCase="'ConnectionProblem'" class="file-error">
        {{status.errorMessage}}
    </span>
    <span *ngSwitchCase="'IOException'" class="file-error" [title]="status.errorMessage">
        IO Error <span (click)="showDialog(stacktraceDialog)" class="fas fa-wrench toolIcon" title="Show details"></span>
        <span *ngIf="showErrorMessages" class="io-error-message">({{status.errorMessage}})</span>
    </span>
    <span *ngSwitchCase="'NoDateField'" class="file-error" [title]="status.errorMessage">
        <span *ngIf="showErrorMessages">({{status.errorMessage}})</span>
        <span *ngIf="!showErrorMessages">No date field</span>
    </span>
    <span *ngSwitchCase="'internal_error'" class="file-error">
        Internal error <span (click)="showDialog(stacktraceDialog)" class="fas fa-wrench toolIcon" title="Show details"></span>
    </span>
    <span *ngSwitchCase="'IncorrectFormatException'" class="file-error"
          title="File content cannot be parsed using the specified log format: {{status.metainfo.format}}">
        Incorrect log format
        <span (click)="showDialog(formatDialog)" class="fas fa-wrench toolIcon" title="Show details"></span>
    </span>
</span>

<ng-template #stacktraceDialog>
    <div class="modal-header">
        <h4 class="modal-title" id="modal-basic-title">Error details</h4>
        <button type="button" class="close" aria-label="Close" (click)="modalRef.hide()">
            <span aria-hidden="true">&times;</span>
        </button>
    </div>
    <div class="modal-body">
        <div class="stacktrace-panel">{{status.detailedErrorMessage}}</div>
    </div>
</ng-template>

<ng-template #formatDialog>
    <div class="modal-header">
        <h4 class="modal-title">Error details</h4>
        <button type="button" class="close" aria-label="Close" (click)="modalRef.hide()">
            <span aria-hidden="true">&times;</span>
        </button>
    </div>
    <div class="modal-body">
        File content cannot be parsed using the specified log format:<br>
        <div class="log-format">{{status.metainfo.format}}</div>
    </div>
</ng-template>